package com.runen.infinitemovement.model.api;

import com.runen.infinitemovement.Constant;
import com.runen.infinitemovement.base.BaseAPI;
import com.runen.infinitemovement.model.base.BaseResponseEntity;
import com.runen.infinitemovement.model.entity.AllTeamGroupUserEntity;
import com.runen.infinitemovement.model.entity.CompanyHomeInfoEntity;
import com.runen.infinitemovement.model.entity.CompanyHomeTimesRankingEntity;
import com.runen.infinitemovement.model.entity.CompanyPersonRankEntity;
import com.runen.infinitemovement.model.entity.LikeListEntity;
import com.runen.infinitemovement.model.entity.MemberEntity;
import com.runen.infinitemovement.model.entity.MyLegionInfoEntity;
import com.runen.infinitemovement.model.entity.TeamListEntity;
import com.runen.infinitemovement.model.entity.TenantCodeEntity;
import com.runen.infinitemovement.model.entity.TenantTitleEntity;
import com.runen.infinitemovement.model.entity.ToptenantEntity;
import com.runen.rxnetlibrary.net.callback.BaseResultCallback;

import java.util.Map;

public class CompanyAPI extends BaseAPI {
    /**
     * 获取公司主页信息
     *
     * @param callback
     */
    public void getCompanyHome(BaseResultCallback<CompanyHomeInfoEntity> callback) {
        get(Constant.GET_COMPANY_HOME_INFO_ACTION, null, callback);
    }

    /**
     * 获取公司排行榜
     *
     * @param str
     * @param callback
     */
    public void getCompanyTimesRanking(String str, BaseResultCallback<CompanyHomeTimesRankingEntity> callback) {
        get(Constant.GET_COMPANY_HOME_TIMES_RANKING_ACTION + str, null, callback);
    }

    /**
     * 查询公司主页本人排行榜信息
     *
     * @param str
     * @param callback
     */
    public void getCompanyPersonRank(String str, BaseResultCallback<CompanyPersonRankEntity> callback) {
        get(Constant.GET_COMPANY_PERSON_RANK_ACTION + str, null, callback);
    }

    /**
     * 添加顶级公司
     *
     * @param str
     * @param callback
     */
    public void addCorps(String str, BaseResultCallback<BaseResponseEntity<String>> callback) {
        postBody(Constant.ADD_TOP_COMPANY, str, callback);
    }

    /**
     * 添加下级部门
     *
     * @param str
     * @param callback
     */
    public void addNextCorps(String str, BaseResultCallback<BaseResponseEntity<?>> callback) {
        postBody(Constant.ADD_CORPS_NEXT_INFO_ACTION, str, callback);
    }

    /**
     * 获取团队列表
     *
     * @param str
     * @param callback
     */
    public void getTeamList(String str, BaseResultCallback<TeamListEntity> callback) {
        get(Constant.GET_TEAM_LIST_ACTION + str, null, callback);
    }

    /**
     * 获取团队成员列表
     *
     * @param callback
     */
    public void getMemberList(String s, BaseResultCallback<MemberEntity> callback) {
        get(Constant.GET_MEMBER_LIST_ACTION + s, null, callback);
    }

    /**
     * 创建或者编辑团队信息
     *
     * @param str
     * @param callback
     */
    public void createOrEditingTeam(String str, BaseResultCallback<BaseResponseEntity<?>> callback) {
        postBody(Constant.CREATE_OR_EDITING_TEAM_ACTION, str, callback);
    }

    /**
     * 编辑军团信息
     *
     * @param str
     * @param callback
     */
    public void updateTeam(String str, BaseResultCallback<BaseResponseEntity<?>> callback) {
        postBody(Constant.UPDATE_NAME_LOGO, str, callback);
    }

    /**
     * 移交军团长
     *
     * @param callback
     */
    public void transferLegion(Map json, BaseResultCallback<BaseResponseEntity<?>> callback) {
        get(Constant.TRANSFER_LEGION, json, callback);
    }

    /**
     * 我的军团长管理
     *
     * @param listener
     */
    public void myLegionInfo(BaseResultCallback<MyLegionInfoEntity> listener) {
        get(Constant.MY_LEGION_INFO, null, listener);
    }

    /**
     * 军团所有成员
     *
     * @param callback
     */
    public void allTeamGroup(Map json, BaseResultCallback<AllTeamGroupUserEntity> callback) {
        get(Constant.ALL_TENAM_USER, json, callback);
    }

    /**
     * 军团点赞
     *
     * @param str
     * @param callback
     */
    public void teamLike(String str, BaseResultCallback<BaseResponseEntity<?>> callback) {
        postBody(Constant.TEAM_LIKE, str, callback);
    }

    /**
     * 军团点赞
     *
     * @param json
     * @param callback
     */
    public void likeListRecord(Map json, BaseResultCallback<LikeListEntity> callback) {
        get(Constant.LIKE_LIST_RECORD, json, callback);
    }

    /**
     * 公告
     *
     * @param json
     * @param callback
     */
    public void tenant(Map json, BaseResultCallback<TenantTitleEntity> callback) {
        get(Constant.TENANT_TITLE, json, callback);
    }

    /**
     * 公告
     *
     * @param json
     * @param callback
     */
    public void updateTenant(Map json, BaseResultCallback<BaseResponseEntity> callback) {
        get(Constant.UPDATE_TENANT_TITLE, json, callback);
    }

    /**
     * 根据军团码获取公司顶级id
     *
     * @param callback
     */
    public void getTenantCodeTopId(String str, BaseResultCallback<ToptenantEntity> callback) {
        get(Constant.GET_TENANT_CODE_TOP_ID + str, null, callback);
    }

    /**
     * 获取我的军团二维码以及code
     *
     * @param callback
     */
    public void getMyTenantCode(BaseResultCallback<TenantCodeEntity> callback) {
        get(Constant.GET_MY_TEANANT_CODE, null, callback);
    }

    /**
     * 验证密码是否正确
     *
     * @param str
     * @param callback
     */
    public void postVerifyPassword(String str, BaseResultCallback<BaseResponseEntity> callback) {
        postBody(Constant.POST_COMPANY_VERIFY_PASSWORD, str, callback);
    }

    /**
     * 踢出公司团队
     */
    public void postKickOut(String str, BaseResultCallback<BaseResponseEntity> callback) {
        postBody(Constant.POST_KICK_OUT, str, callback);
    }
}
